package de.tabuma.pm.view;

import de.tabuma.pm.project.view.*;
import de.tabuma.pm.*;
import de.tabuma.lib.*;
import java.io.*;
import java.util.*;
import java.util.logging.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 *
 * @author alefen
 */
public class view extends tabumaview {

    public view(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void processRequest(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {

        String project = "project";

        String paramAction = (String) request.getAttribute(constants.paramAction);
        int paramActionInt = constants.ACTION_LIST;
        if(paramAction!=null) {
            paramActionInt = Integer.valueOf(paramAction).intValue();
        }

        out.println("<div class=\"contentBoxed\">");
        out.println("<div class=\"contentHeader\">"+project+"</div>");
        out.println("</div>");

        switch(paramActionInt) {
            case constants.ACTION_CREATE:
                create cpv = new create(this.getServlet(), this.getParameter());
                cpv.processRequest(context, request, response, out);
                break;
            case constants.ACTION_REMOVE:
                remove rpv = new remove(this.getServlet(), this.getParameter());
                rpv.processRequest(context, request, response, out);
                break;
            case constants.ACTION_LIST:
                list lpv = new list(this.getServlet(), this.getParameter());
                lpv.processRequest(context, request, response, out);
                break;
            case constants.ACTION_OVERVIEW:
                de.tabuma.pm.project.view.view pov = new de.tabuma.pm.project.view.view(this.getServlet(), this.getParameter());
                pov.processRequest(context, request, response, out);
                break;
        }

    }

}